<template>
	<view class="content">
		<view class="header">
			<img src="./img/bg.png" class="bg" />
			<view class="user_info">
				<view class="avatar">
					<view class="pic">
						<img src="./img/avatar.png" class="img"  />
					</view>
					<view class="name">
						<view class="txt">昵称：ATM_43512630</view>
						<view class="txt">ID:43512630</view>
					</view>
				</view>
				<img src="./img/setting.png" class="setting" />
			</view>
		</view>
		<div class="list">
			<div class="item" v-for="(item,index) in list" :key="index">
				<template v-if="item.length">
					<div class="sub" v-for="(item2,index2) in item" :key="index2" @click="itemClick(item2)">
						<div class="title">
							<img :src="item2.icon" class="pic" />
							<text class="txt">{{item2.title}}</text>
						</div>
						<img src="./img/arrow.png" class="arrow" />
					</div>
				</template>
			</div>
		</div>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[
					[
						{
							title:'我的账户',
							icon:require('./img/1.png'),
							path:'',
						},
						{
							title:'交易记录',
							icon:require('./img/2.png'),
							path:'',
						},
						{
							title:'修改密码',
							icon:require('./img/3.png'),
							path:'',
						}
					],
					[
						{
							title:'邀请好友',
							icon:require('./img/7.png'),
							path:'',
						},
						{
							title:'联系我们',
							icon:require('./img/8.png'),
							path:'',
						},
						{
							title:'吐槽一下',
							icon:require('./img/9.png'),
							path:'',
						},
					]
				]
			}
		},
		onLoad() {

		},
		methods: {
			itemClick(type){
				uni.showToast({
					title: '开发中，敬请期待!',
					icon:'none',
				})
			}
		}
	}
</script>

<style lang="scss">
.header{
	width:100%;
	height:200rpx;
	position: relative;
	.bg{
		width:100%;
		height:100%;
	}
	.user_info{
		position: absolute;
		top: 50%;
		left: 0;
		width: 100%;
		transform: translateY(-50%);
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding-left:48rpx;
		padding-right:48rpx;
		.avatar{
			display: flex;
			justify-content: space-between;
			align-items: center;
			.pic{
				width: 120rpx;
				height:120rpx;
				border-radius: 50%;
				border:4rpx solid #fff;
				overflow: hidden;
				margin-right: 16rpx;
				.img{
					width: 100%;
					height:100%;
				}
			}
			.name{
				.txt{
					font-size: 28rpx;
					color: #fff;
					padding: 8rpx 0;
				}
			}
		}
		.setting{
			width:43rpx;
			height:45rpx;
		}
	}
}
.list{
	padding:24rpx;
	.item{
		background-color: #fff;
		border-radius: 20rpx;
		overflow: hidden;
		margin-bottom: 24rpx;
		.sub{
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 24rpx;
			border-bottom:1px solid #ececec;
			.title{
				display: flex;
				align-items: center;
				.pic{
					width: 40rpx;
					height:40rpx;
					margin-right: 12rpx;
				}
				.txt{
					font-size: 28rpx;
				}
			}
			.arrow{
				width: 20rpx;
				height:35rpx;
			}
			&:last-child{
				border-bottom: 0;
			}
		}
	}
}
</style>
